package com.iwhalecloud.citybrain.flow.platform.manager.application.common.enums;

import com.iwhalecloud.citybrain.flow.platform.manager.application.common.constants.ModelConfigConstants;
import com.iwhalecloud.citybrain.flow.platform.manager.domain.enums.ReadOperateTypeEnum;

import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

public enum ModelConfigEnum {
    /**
     * 节点样式
     */
    StartNoneEventStyle("StartNoneEventStyle",ModelConfigConstants.StartNoneEventStyle),
    EndNoneEventStyle("EndNoneEventStyle",ModelConfigConstants.StartNoneEventStyle),
    UserTaskStyle("UserTaskStyle",ModelConfigConstants.StartNoneEventStyle),
    IncludeGatewayStyle("IncludeGatewayStyle",ModelConfigConstants.StartNoneEventStyle),

    FlowSequenceShape("FlowSequence",ModelConfigConstants.FlowSequenceShape),

    /**
     * 节点尺寸
     */
    StartNoneEventSize("StartNoneEventSize",ModelConfigConstants.StartEndEventSize),
    EndNoneEventSize("EndNoneEventSize",ModelConfigConstants.StartEndEventSize),
    IncludeGatewaySize("IncludeGatewaySize",ModelConfigConstants.IncludeGatewaySize),
    UserTaskSize("UserTaskSize",ModelConfigConstants.UserTaskSize),

    /**
     * 节点颜色
     */
    StartNoneEventColor("StartNoneEventColor",ModelConfigConstants.StartNoneEventColor),
    IncludeGatewayColor("IncludeGatewayColor",ModelConfigConstants.IncludeGatewayColor),
    UserTaskColor("UserTaskColor",ModelConfigConstants.UserTaskColor),
    EndNoneEventColor("EndNoneEventColor",ModelConfigConstants.EndNoneEventColor);

    private String type;

    private String value;

    ModelConfigEnum(String type, String desc) {
        this.type = type;
        this.value = desc;
    }

    public String getType() {
        return type;
    }

    public String getValue() {
        return value;
    }

    private static Map<String, String> typeToValue = new HashMap<>();

    static {
        Arrays.asList(values()).forEach(item -> typeToValue.put(item.getType(), item.getValue()));
    }
    public static String getValueByType(String type) {
        return typeToValue.get(type);
    }

    public static Map<String, String> getTypeToValue() {
        return typeToValue;
    }

    public static void setTypeToValue(Map<String, String> typeToValue) {
        ModelConfigEnum.typeToValue = typeToValue;
    }

}
